use crate::fairing::device::CaCertificate;
use crate::guard::userauth::AdminUserData;
use rocket::route::Route;
use rocket::State;

#[get("/ca_certificate")]
async fn get_ca_certificate(cert: &State<CaCertificate>, _user: AdminUserData) -> String {
    cert.0.certificate().pem()
}

pub fn route() -> Vec<Route> {
    routes![get_ca_certificate]
}
